﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Windows.Media.Imaging;

namespace STEditor.Classes.Tests
{
    [TestClass]
    public class STTileImageCollectionTests
    {
        [TestMethod]
        public void STTileImageCollection_Should_Have_Selected_Tile_Property()
        {

            var image = new STFrame();
            
            var collection = new STTileImageCollection();
            collection.Add(image);
            collection.SelectedTile = image;

            Assert.AreSame(image, collection.SelectedTile, "SelectedTile was not set correctly");

        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void STTileImageCollection_Should_Not_Allow_Selection_Of_Image_Not_In_List()
        {

            var image = new STFrame();

            var collection = new STTileImageCollection();
            //collection.Add(image);
            collection.SelectedTile = image;

            Assert.Fail("Setting of SelectedTile did not fail");

        }


    }
}
